KeyValueInputs AddRowButton - Translate strings (HDS-6114)#3681
KeyValueInputs AddRowButton - Translate strings (HDS-6114)#3681KristinLBradley wants to merge 5 commits intomainfrom
KeyValueInputs AddRowButton - Translate strings (HDS-6114)#3681Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
| export default class HdsFormKeyValueInputsAddRowButton extends Component<HdsFormKeyValueInputsAddRowButtonSignature> { | ||
| @service declare readonly hdsIntl: HdsIntlService; | ||
|
|
||
| get ariaLabel(): string { |
There was a problem hiding this comment.
@KristinLBradley (question) do you think that there should be a test for this, confirming that it does what we think it does?
There was a problem hiding this comment.
I'm not finding other examples of tests for things like this so far. But maybe we should be adding tests? I can ask in the next eng sync, thanks.
There was a problem hiding this comment.
Btw, currently we just test that the value of this is not empty. Would it be better to test that it has the default value?
/integration/components/hds/form/key-value-inputs/add-row-button-test.gts
test('it should provide an `aria-description` attribute', async function (assert) {
await render(
<template>
<HdsFormKeyValueInputsAddRowButton
id="test-form-key-value-add-row-button"
/>
</template>,
);
assert
.dom('#test-form-key-value-add-row-button')
.hasAttribute(
'aria-description',
/.+/,
'aria-description should not be empty',
);
});
There was a problem hiding this comment.
I think "not empty" is fine since it can be customized. But you could have another test that ensures the default is the fallback. 🤔
There was a problem hiding this comment.
I went ahead and updated the test to instead check for the default value. Please let me know if it looks ok now or if I should change/add anything else. Thanks!
There was a problem hiding this comment.
@shleewhite tagging you too just to let you know about the latest update I pushed.
packages/components/src/components/hds/form/key-value-inputs/add-row-button.gts
Outdated
Show resolved
Hide resolved
Added translated strings for KeyValueInputs AddRowButton ariaLabel and text.
Co-authored-by: Lee White <lee.white@hashicorp.com>
aeb39b8 to
75042e4
Compare
📌 Summary
If merged, this PR translates previously hard-coded strings in the
KeyValueInputsAddRowButton.🔗 External links
👀 Component checklist
💬 Please consider using conventional comments when reviewing this PR.
📋 PCI review checklist
Examples of changes to controls include access controls, encryption, logging, etc.
Examples include changes to operating systems, ports, protocols, services, cryptography-related components, PII processing code, etc.